import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import Home from '../views/Home.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  // {
  //   path: '/about',
  //   name: 'axios',
  //   component: () => import('../views/About.vue')
  // },
  {
    path: '/Lifecycle',
    name: '生命周期',
    component: () => import('../views/demoLifecycle.vue')
  },
  {
    path: '/computWatch',
    name: 'compute 和watch',
    component: () => import('../views/computWatch.vue')
  },
  {
    path: '/vuex',
    name: 'vuex状态管理',
    component: () => import('../views/vuex.vue')
  },
  {
    path: '/setup',
    name: 'setup',
    component: () => import('../views/setup.vue')
  },
  {
    path: '/reactive',
    name: 'reactive',
    component: () => import('../views/reactive.vue')
  },
  {
    path: '/ref',
    name: 'ref',
    component: () => import('../views/ref.vue')
  },
  {
    path: '/teleport',
    name: '外部组件',
    component: () => import('../views/teleport.vue')
  },
  {
    path: '/suspense',
    name: '异步组件',
    component: () => import('../views/suspense.vue')
  },
  {
    path: '/axios',
    name: 'axios',
    component: () => import('../views/axios.vue')
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
}) 

export default router
